package com.simon.train.business.controller.web;


import com.simon.train.business.dto.DailyTrainTicketQueryDto;
import com.simon.train.business.service.DailyTrainTicketService;
import com.simon.train.business.vo.DailyTrainTicketQueryVO;
import com.simon.train.common.Result.Result;
import com.simon.train.common.vo.PageVO;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/web/dailyTrainTicket")
public class DailyTrainTicketController {

    @Resource
    private DailyTrainTicketService dailyTrainTicketService;

    @GetMapping("/queryList")
    public Result<PageVO<DailyTrainTicketQueryVO>> DailyTrainTicketQueryList(@Valid DailyTrainTicketQueryDto dailyTrainTicketQueryDto){
         /**
         * businessId通过线程变量获取 从而不需要由前端传入 保证了效率和安全性
         */
        PageVO<DailyTrainTicketQueryVO> lists = dailyTrainTicketService.QueryDailyTrainTicketList(dailyTrainTicketQueryDto);
        return new Result<>(lists);
    }

}
